package com.CGFrame.struts.bean.keypath;

import java.text.SimpleDateFormat;
import java.util.Date;

public class TaskNode implements Comparable {
	private String description;
	private Date STime;
	private Date ETime;
	private String tip;
	private double percent;
	public TaskNode(String description,Date STime,Date ETime,String tip,double percent)
	{
		this.description = description;
		this.STime = STime;
		this.ETime = ETime;
		this.tip = tip;
		this.percent = percent;
	}
	public String getDescription()
	{
		return description;
	}
	public String getSTime()
	{
		  String dataText = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.s").format(STime);   
		    

		return dataText;
	}
	public Date getStartDate()
	{
		return this.STime;
	}
	public String getETime()
	{
		String  dataText = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.s").format(ETime);
		return dataText;
	}
	public Date getEndDate()
	{
		return this.ETime;
	}
	public String getTip()
	{
		return tip;
	}
	public void setTip(String tip)
	{
		this.tip = tip;
	}
	public Double getPercent()
	{
		return percent;
	}
	
	public void setPercent(double percent)
	{
		this.percent = percent;
	}
	public int compareTo(Object anotherNode) {
		if (this == anotherNode) {
            return 0;
        }

		if (anotherNode!=null && anotherNode instanceof TaskNode )
		{
			
			return this.STime.compareTo(( (TaskNode)anotherNode ).getStartDate());
		}
		else
		{
			return 1;
		}
		
	}
}
